from selenium import webdriver
from selenium.webdriver.common.by import By
import time
d = webdriver.Chrome()
d.get('https://www.qq.com')
d.maximize_window()
time.sleep(1)
# 定位搜索图标
search_button = d.find_element(By.CSS_SELECTOR,'[id="searchBtn"]')
res = search_button.is_displayed() # is_displayed()方法，显示返回True，不显示返回False
print(res)

# 隐藏元素： 只能定位、不可以操作 click() send_keys() clear()....
# style="display:none;"     type="hidden"

# 如何执行js 语句  JavaScript
# window.scrollTo(0,与顶部的距离);  拉动窗口的滚动条
js = "window.scrollTo(0,500);"
d.execute_script(js)

time.sleep(5)

